function validateUserId() { 
    var target = document.getElementById("userid"); 
    var url = "validate?id=" + encodeURIComponent(target.value); 
    var ajax = new AJAXInteraction(url, validateCallback); 
    ajax.doGet(); 
}

function validateCallback(responseXML) {

	   var msg = responseXML.
	       getElementsByTagName("valid")[0].firstChild.nodeValue;

	   if (msg == "false") {

	       var mdiv = document.getElementById("userIdMessage");

	       // set the style on the div to invalid

	       mdiv.className = "bp_invalid";
	       mdiv.innerHTML = "Invalid User Id";
	       //var submitBtn = document.getElementById("submit_btn");
	       //submitBtn.disabled = true;

	    } else {

	       var mdiv = document.getElementById("userIdMessage");

	       // set the style on the div to valid

	       mdiv.className = "bp_valid";
	       mdiv.innerHTML = "Valid User Id";
	       //var submitBtn = document.getElementById("submit_btn");
	       //submitBtn.disabled = false;
	    }  
	}
